import 'package:gold/generated/json/base/json_field.dart';
import 'package:gold/generated/json/shop_model.g.dart';
import 'dart:convert';

@JsonSerializable()
class ShopModel {
	/// 店铺用户信息
	ShopUser? user;
	/// 待收货款
	@JSONField(name: 'unpaid_amount')
	double? unpaidAmount;
	/// 已收货款
	@JSONField(name: 'paid_amount')
	double? paidAmount;
	/// 销售总额
	@JSONField(name: 'total_amount')
	double? totalAmount;
	/// 推广员人数
	@JSONField(name: 'sales_agent')
	int? salesAgent;
	/// 进店人数
	@JSONField(name: 'visitor_count')
	int? visitorCount;
	/// 订单总数
	@JSONField(name: 'order_count')
	int? orderCount;
	/// 待发货订单数
	@JSONField(name: 'unshipped_count')
	int? unshippedCount;
	/// 待支付订单数
	@JSONField(name: 'unpaid_count')
	int? unpaidCount;
	/// 待确认订单数
	@JSONField(name: 'unconfirmed_count')
	int? unconfirmedCount;

	ShopModel();

	factory ShopModel.fromJson(Map<String, dynamic> json) => $ShopModelFromJson(json);

	Map<String, dynamic> toJson() => $ShopModelToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class ShopUser {
	/// 用户ID
	int? uid;
	/// 用户头像
	String? avatar;
	/// 用户昵称
	String? nickname;

	ShopUser();

	factory ShopUser.fromJson(Map<String, dynamic> json) => $ShopUserFromJson(json);

	Map<String, dynamic> toJson() => $ShopUserToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}